import request from "@/util/QcRequest.js";

//分页查询常见缺陷
export function getCommonDefectPage(pageNum, size, commonDefect) {
    return request({
        url: '/commonDefect/list',
        method: 'get',
        params: {
            pageNum,
            size,
            ...commonDefect
        }
    })
}

// 根据编码查询
export function getCommonDefectById(id) {
    return request({
        url: `/commonDefect/get/${id}`,
        method: 'get'
    })
}

// 新增
export function addCommonDefect(data) {
    return request({
        url: '/commonDefect/add',
        method: 'post',
        data: data
    })
}

// 更新
export function updateCommonDefect(data) {
    return request({
        url: '/commonDefect/update',
        method: 'post',
        data: data
    })
}

// 删除
export function deleteCommonDefect(id) {
    return request({
        url: `/commonDefect/delete/${id}`,
        method: 'delete',
    })
}

// 批量删除
export function batchDeleteCommonDefect(ids) {
    return request({
        url: '/commonDefect/batchDelete',
        method: 'delete',
        data: ids
    })
}